/*

Author   : chaos

FileName : dynamic_array.cpp

Date     : 10/08/17 09:56:54

*/
#include <iostream>
using namespace std;

int main(int argc ,char *argv[])
{
    int n,i;

    cout << "Please input the size of array:" << endl;
    cin >> n;

    int *ptr = new int [n];

    cout << "Please input the value of array : " << endl;

    for (i=0;i<n;i++)
    {
        cout << "array [" << i <<"] = ";
        cin >> *(ptr + i);
    }

    cout << endl << "The result is ..." << endl;

    for (i=0;i<n;i++)
    {
        cout << "array [" << i << "] =" << ptr[i];

        cout << endl;
    }

    delete [] ptr;

    return 0;
}
